<template>
	<svg-icon name="reload" @click="refresh"></svg-icon>
</template>

<script setup lang="ts">
const router = useRouter()
const route = useRoute()
const tabsStore = useStore.tabsStore();

const refresh = () => {
	tabsStore.delCachedView(route).then(() => {
		nextTick(() => {
			let path = route.path;
			path = path.replaceAll('\/', '@@@');
			router.replace({ path: '/admin/redirect/' + path }).catch(err => {
				console.warn(err)
			})
		})
	})
}
</script>
